package com.剑指offer.no03;

import java.util.*;

public class Solution {
    public int findRepeatNumber(int[] nums) {
        int result = -1;
        Set<Integer> mySet = new HashSet<Integer>();

        for (int i = 0; i <= nums.length - 1; i++){
            if(mySet.add(nums[i])){
                result = nums[i];
                break;
            }
        }


            return result;
    }
}